<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    <title>sign_in</title>
    <meta charset="utf-8">
  	<link rel="stylesheet" href="assets/css/amazeui.min.css" />
  	<link rel="stylesheet" href="assets/css/admin.css">
  	<link rel="stylesheet" href="assets/css/app.css">
  	<script src="assets/js/jquery.min.js"></script>
	<script>
	function login(){
	    var jsonData = {  
	            "username" :$('#username').val(),  
	            "password" :$('#password').val() 
	    };
	    $.ajax({
	        type:'post',
	        url:'login',
	        contentType:'application/json;charset=utf-8',//指定为json类型
	        //数据格式是json串，商品信息
	        data:JSON.stringify(jsonData),
	        success:function(data){//返回json结果
	        	if(data['status'] == "success")
	            	window.location.href="manage";
	            else
	            	alert("登录失败");
	            	
	        }       
	    }); 
		}
	</script>
	</head>
<body data-type="login">

  <div class="am-g myapp-login">
	<div class="myapp-login-logo-block  tpl-login-max">
		<div class="myapp-login-logo-text">
			<div class="myapp-login-logo-text">
				<i class="am-icon-skyatlas"></i>
				
			</div>
		</div>

		<div class="login-font">
			<i>Log In </i> or <span> Sign Up</span>
		</div>
		<div class="am-u-sm-10 login-am-center">
			<form class="am-form" action="" id="login-form" method="post">
				<fieldset>
					<div class="am-form-group">
						<input type="text" class="" id="username" name="username" placeholder="输入你的帐号">
					</div>
					<div class="am-form-group">
						<input type="password" class=""  id="password" name="password" placeholder="输入你的密码">
					</div>
					<p><button type="button" onclick="login()" class="am-btn am-btn-default">登录</button></p>
				</fieldset>
			</form>
		</div>
	</div>
</div>
  <script src="assets/js/amazeui.min.js"></script>
  <script src="assets/js/app.js"></script>
</body>
</body>
</html>
